1. Field of the Invention
The present invention relates to an address conversion unit for a memory device provided with a nonvolatile memory such as a flash memory capable of rewriting data therein.
2. Description of Related Art
The portable device for music data and video data has begun using a memory device provided with a nonvolatile memory such as a flash memory. The flash memory allows data to be rewritten, has a high portability, and requires no back-up power such as a battery or the like.
However, the speed of writing data into the flash memory is slower than the speed of transferring data to a buffer in the memory device, whereby a wait time is generated.
A conventional method of efficiently writing data into the flash memory is disclosed in Japanese Laid open Publication No. 06-301601, in which the data is written in parallel into a plurality of physical blocks.
In addition, in order to access a data stored in the flash memory, the physical address of the data should be specified by means of the logical address. For this purpose, RAM in the memory device is provided with a table to convert the logical address of the stored data in the flash memory to the physical address in the flash memory.
In recent years, there is a tendency that information handled by the portable device has increased in volume. And in order to process such mass of information, it is designed so that the memory device increases the storage capacity by adding more nonvolatile memories.
However, the more the storage capacity increases, the larger the table becomes in size. This causes the increase of the RAM's capacity and physical volume.
For example, in a case where the storage capacity of the memory device is 1 gigabyte and the size of the logical block in the memory device is 16 kilobytes, the number of logical blocks formed on the memory device becomes 2^16; therefore, an address to specify a logical block can be represented by 16 bits. That is, the table to convert a logical address to a physical address on a flash memory must have a capacity of 16 bits×2^16=128 kilobytes. Besides, the logical block is a data block specified by the logical address.
Furthermore, the effective writing method for the flash memory has been disclosed in the aforementioned prior art, while no prior art discloses a method for writing data which a reading means can access at high-speed.
In the conventional writing method, for example, where the data is written in consecutive physical blocks from a first to a fifth in order, the data in the fifth physical block can be accessed as follows.
First of all, the reading means reads the first physical block and obtains the second physical block's address stored in the last section of the first physical block, and then reads the second physical block. Likewise, the reading means reads the third physical block after the second physical block, obtains the fourth physical block's address stored in the third physical block, and accesses the fourth physical block. And at last, the reading means obtains the fifth physical block's address stored in the fourth physical block, and accesses the fifth physical block. In such way, in order to access the fifth physical block, the reading means must read all the physical blocks from the first to the fourth. This was a factor to increase the access time.
Additionally, the data stored in the flash memory is to be erased in physical blocks. Therefore, regarding a physical block in the flash memory, when the data in the physical block is erased, if the physical block stores both invalid data and valid data, the valid data stored in the same block is also erased at the same time. To avoid this problem, a data erasing means saves the valid data in the other storage medium, and then erases the data of the physical block, namely, the saving is to be executed in the prior art. Therefore, the saving must be improved more than ever, in order to perform the data erasing with high efficiency.